import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

export default {
  install(app) {
    // 安装Element Plus
    app.use(ElementPlus, {
      locale: zhCn,
      size: 'default'
    })
    
    // 注册所有图标
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
    
    // 全局配置
    app.config.globalProperties.$ELEMENT = {
      size: 'default',
      zIndex: 3000
    }
  }
}
